import Vue from "vue";
import VueRouter from "vue-router";
import Layout from "../layout";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: Layout,
    children: [
      {
        path: "/housingManagement",
        component: () => import("../views/HousingManagement"),
        meta: {
          title: "房源管理",
        },
      },
      {
        path: "/liveBroadcastManagement",
        component: () => import("../views/LiveBroadcastManagement"),
        meta: {
          title: "直播管理",
        },
      },
      {
        path: "/shoppingManagement",
        component: () => import("../views/ShoppingManagement"),
        meta: {
          title: "团购管理",
        },
      },
      {
        path: "/auditManagement",
        component: () => import("../views/AuditManagement"),
        meta: {
          title: "审核管理",
        },
      },
      {
        path: "/orderManagement",
        component: () => import("../views/OrderManagement"),
        meta: {
          title: "订单管理",
        },
      },
      {
        path: "/informationManagement",
        component: () => import("../views/InformationManagement"),
        meta: {
          title: "资讯管理",
        },
      },
      {
        path: "/brokerManagement",
        component: () => import("../views/BrokerManagement"),
        meta: {
          title: "经纪人管理",
        },
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
